Optimal. Leaf size=97 \[ \frac {3 \sin (a-c+(b-d) x)}{8 (b-d)}-\frac {\sin (3 a-c+(3 b-d) x)}{8 (3 b-d)}-\frac {3 \sin (a+c+(b+d) x)}{8 (b+d)}+\frac {\sin (3 a+c+(3 b+d) x)}{8 (3 b+d)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 97, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 2, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {4665, 2717}
\begin {gather*} \frac {3 \sin (a+x (b-d)-c)}{8 (b-d)}-\frac {\sin (3 a+x (3 b-d)-c)}{8 (3 b-d)}-\frac {3 \sin (a+x (b+d)+c)}{8 (b+d)}+\frac {\sin (3 a+x (3 b+d)+c)}{8 (3 b+d)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2717
Rule 4665
Rubi steps
\begin {align*} \int \sin ^3(a+b x) \sin (c+d x) \, dx &=\int \left (\frac {3}{8} \cos (a-c+(b-d) x)-\frac {1}{8} \cos (3 a-c+(3 b-d) x)-\frac {3}{8} \cos (a+c+(b+d) x)+\frac {1}{8} \cos (3 a+c+(3 b+d) x)\right ) \, dx\\ &=-\left (\frac {1}{8} \int \cos (3 a-c+(3 b-d) x) \, dx\right )+\frac {1}{8} \int \cos (3 a+c+(3 b+d) x) \, dx+\frac {3}{8} \int \cos (a-c+(b-d) x) \, dx-\frac {3}{8} \int \cos (a+c+(b+d) x) \, dx\\ &=\frac {3 \sin (a-c+(b-d) x)}{8 (b-d)}-\frac {\sin (3 a-c+(3 b-d) x)}{8 (3 b-d)}-\frac {3 \sin (a+c+(b+d) x)}{8 (b+d)}+\frac {\sin (3 a+c+(3 b+d) x)}{8 (3 b+d)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.58, size = 91, normalized size = 0.94 \begin {gather*} \frac {1}{8} \left (\frac {3 \sin (a-c+b x-d x)}{b-d}-\frac {\sin (3 a-c+3 b x-d x)}{3 b-d}+\frac {\sin (3 a+c+3 b x+d x)}{3 b+d}-\frac {3 \sin (a+c+(b+d) x)}{b+d}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.22, size = 90, normalized size = 0.93
method | result | size |
default | \(\frac {3 \sin \left (a -c +\left (b -d \right ) x \right )}{8 \left (b -d \right )}-\frac {\sin \left (3 a -c +\left (3 b -d \right ) x \right )}{8 \left (3 b -d \right )}-\frac {3 \sin \left (a +c +\left (b +d \right ) x \right )}{8 \left (b +d \right )}+\frac {\sin \left (3 a +c +\left (3 b +d \right ) x \right )}{24 b +8 d}\) | \(90\) |
risch | \(\frac {27 \sin \left (b x -d x +a -c \right ) b^{3}}{8 \left (-3 b +d \right ) \left (-b +d \right ) \left (3 b +d \right ) \left (b +d \right )}+\frac {27 \sin \left (b x -d x +a -c \right ) b^{2} d}{8 \left (-3 b +d \right ) \left (-b +d \right ) \left (3 b +d \right ) \left (b +d \right )}-\frac {3 \sin \left (b x -d x +a -c \right ) b \,d^{2}}{8 \left (-3 b +d \right ) \left (-b +d \right ) \left (3 b +d \right ) \left (b +d \right )}-\frac {3 \sin \left (b x -d x +a -c \right ) d^{3}}{8 \left (-3 b +d \right ) \left (-b +d \right ) \left (3 b +d \right ) \left (b +d \right )}-\frac {27 \sin \left (b x +d x +a +c \right ) b^{3}}{8 \left (3 b -d \right ) \left (b -d \right ) \left (3 b +d \right ) \left (b +d \right )}+\frac {27 \sin \left (b x +d x +a +c \right ) b^{2} d}{8 \left (3 b -d \right ) \left (b -d \right ) \left (3 b +d \right ) \left (b +d \right )}+\frac {3 \sin \left (b x +d x +a +c \right ) b \,d^{2}}{8 \left (3 b -d \right ) \left (b -d \right ) \left (3 b +d \right ) \left (b +d \right )}-\frac {3 \sin \left (b x +d x +a +c \right ) d^{3}}{8 \left (3 b -d \right ) \left (b -d \right ) \left (3 b +d \right ) \left (b +d \right )}-\frac {3 \sin \left (3 b x -d x +3 a -c \right ) b^{3}}{8 \left (-3 b +d \right ) \left (-b +d \right ) \left (3 b +d \right ) \left (b +d \right )}-\frac {\sin \left (3 b x -d x +3 a -c \right ) b^{2} d}{8 \left (-3 b +d \right ) \left (-b +d \right ) \left (3 b +d \right ) \left (b +d \right )}+\frac {3 \sin \left (3 b x -d x +3 a -c \right ) b \,d^{2}}{8 \left (-3 b +d \right ) \left (-b +d \right ) \left (3 b +d \right ) \left (b +d \right )}+\frac {\sin \left (3 b x -d x +3 a -c \right ) d^{3}}{8 \left (-3 b +d \right ) \left (-b +d \right ) \left (3 b +d \right ) \left (b +d \right )}+\frac {3 \sin \left (3 b x +d x +3 a +c \right ) b^{3}}{8 \left (3 b -d \right ) \left (b -d \right ) \left (3 b +d \right ) \left (b +d \right )}-\frac {\sin \left (3 b x +d x +3 a +c \right ) b^{2} d}{8 \left (3 b -d \right ) \left (b -d \right ) \left (3 b +d \right ) \left (b +d \right )}-\frac {3 \sin \left (3 b x +d x +3 a +c \right ) b \,d^{2}}{8 \left (3 b -d \right ) \left (b -d \right ) \left (3 b +d \right ) \left (b +d \right )}+\frac {\sin \left (3 b x +d x +3 a +c \right ) d^{3}}{8 \left (3 b -d \right ) \left (b -d \right ) \left (3 b +d \right ) \left (b +d \right )}\) | \(730\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 789 vs.
\(2 (89) = 178\).
time = 0.33, size = 789, normalized size = 8.13 \begin {gather*} -\frac {{\left (3 \, b^{3} \sin \left (c\right ) - b^{2} d \sin \left (c\right ) - 3 \, b d^{2} \sin \left (c\right ) + d^{3} \sin \left (c\right )\right )} \cos \left ({\left (3 \, b + d\right )} x + 3 \, a + 2 \, c\right ) - {\left (3 \, b^{3} \sin \left (c\right ) - b^{2} d \sin \left (c\right ) - 3 \, b d^{2} \sin \left (c\right ) + d^{3} \sin \left (c\right )\right )} \cos \left ({\left (3 \, b + d\right )} x + 3 \, a\right ) + {\left (3 \, b^{3} \sin \left (c\right ) + b^{2} d \sin \left (c\right ) - 3 \, b d^{2} \sin \left (c\right ) - d^{3} \sin \left (c\right )\right )} \cos \left (-{\left (3 \, b - d\right )} x - 3 \, a + 2 \, c\right ) - {\left (3 \, b^{3} \sin \left (c\right ) + b^{2} d \sin \left (c\right ) - 3 \, b d^{2} \sin \left (c\right ) - d^{3} \sin \left (c\right )\right )} \cos \left (-{\left (3 \, b - d\right )} x - 3 \, a\right ) - 3 \, {\left (9 \, b^{3} \sin \left (c\right ) - 9 \, b^{2} d \sin \left (c\right ) - b d^{2} \sin \left (c\right ) + d^{3} \sin \left (c\right )\right )} \cos \left ({\left (b + d\right )} x + a + 2 \, c\right ) + 3 \, {\left (9 \, b^{3} \sin \left (c\right ) - 9 \, b^{2} d \sin \left (c\right ) - b d^{2} \sin \left (c\right ) + d^{3} \sin \left (c\right )\right )} \cos \left ({\left (b + d\right )} x + a\right ) - 3 \, {\left (9 \, b^{3} \sin \left (c\right ) + 9 \, b^{2} d \sin \left (c\right ) - b d^{2} \sin \left (c\right ) - d^{3} \sin \left (c\right )\right )} \cos \left (-{\left (b - d\right )} x - a + 2 \, c\right ) + 3 \, {\left (9 \, b^{3} \sin \left (c\right ) + 9 \, b^{2} d \sin \left (c\right ) - b d^{2} \sin \left (c\right ) - d^{3} \sin \left (c\right )\right )} \cos \left (-{\left (b - d\right )} x - a\right ) - {\left (3 \, b^{3} \cos \left (c\right ) - b^{2} d \cos \left (c\right ) - 3 \, b d^{2} \cos \left (c\right ) + d^{3} \cos \left (c\right )\right )} \sin \left ({\left (3 \, b + d\right )} x + 3 \, a + 2 \, c\right ) - {\left (3 \, b^{3} \cos \left (c\right ) - b^{2} d \cos \left (c\right ) - 3 \, b d^{2} \cos \left (c\right ) + d^{3} \cos \left (c\right )\right )} \sin \left ({\left (3 \, b + d\right )} x + 3 \, a\right ) - {\left (3 \, b^{3} \cos \left (c\right ) + b^{2} d \cos \left (c\right ) - 3 \, b d^{2} \cos \left (c\right ) - d^{3} \cos \left (c\right )\right )} \sin \left (-{\left (3 \, b - d\right )} x - 3 \, a + 2 \, c\right ) - {\left (3 \, b^{3} \cos \left (c\right ) + b^{2} d \cos \left (c\right ) - 3 \, b d^{2} \cos \left (c\right ) - d^{3} \cos \left (c\right )\right )} \sin \left (-{\left (3 \, b - d\right )} x - 3 \, a\right ) + 3 \, {\left (9 \, b^{3} \cos \left (c\right ) - 9 \, b^{2} d \cos \left (c\right ) - b d^{2} \cos \left (c\right ) + d^{3} \cos \left (c\right )\right )} \sin \left ({\left (b + d\right )} x + a + 2 \, c\right ) + 3 \, {\left (9 \, b^{3} \cos \left (c\right ) - 9 \, b^{2} d \cos \left (c\right ) - b d^{2} \cos \left (c\right ) + d^{3} \cos \left (c\right )\right )} \sin \left ({\left (b + d\right )} x + a\right ) + 3 \, {\left (9 \, b^{3} \cos \left (c\right ) + 9 \, b^{2} d \cos \left (c\right ) - b d^{2} \cos \left (c\right ) - d^{3} \cos \left (c\right )\right )} \sin \left (-{\left (b - d\right )} x - a + 2 \, c\right ) + 3 \, {\left (9 \, b^{3} \cos \left (c\right ) + 9 \, b^{2} d \cos \left (c\right ) - b d^{2} \cos \left (c\right ) - d^{3} \cos \left (c\right )\right )} \sin \left (-{\left (b - d\right )} x - a\right )}{16 \, {\left (9 \, b^{4} \cos \left (c\right )^{2} + 9 \, b^{4} \sin \left (c\right )^{2} + {\left (\cos \left (c\right )^{2} + \sin \left (c\right )^{2}\right )} d^{4} - 10 \, {\left (b^{2} \cos \left (c\right )^{2} + b^{2} \sin \left (c\right )^{2}\right )} d^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.83, size = 115, normalized size = 1.19 \begin {gather*} \frac {{\left (7 \, b^{2} d - d^{3} - {\left (b^{2} d - d^{3}\right )} \cos \left (b x + a\right )^{2}\right )} \cos \left (d x + c\right ) \sin \left (b x + a\right ) + 3 \, {\left ({\left (b^{3} - b d^{2}\right )} \cos \left (b x + a\right )^{3} - {\left (3 \, b^{3} - b d^{2}\right )} \cos \left (b x + a\right )\right )} \sin \left (d x + c\right )}{9 \, b^{4} - 10 \, b^{2} d^{2} + d^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 937 vs.
\(2 (76) = 152\).
time = 2.38, size = 937, normalized size = 9.66 \begin {gather*} \begin {cases} x \sin ^{3}{\left (a \right )} \sin {\left (c \right )} & \text {for}\: b = 0 \wedge d = 0 \\\frac {3 x \sin ^{3}{\left (a - d x \right )} \sin {\left (c + d x \right )}}{8} - \frac {3 x \sin ^{2}{\left (a - d x \right )} \cos {\left (a - d x \right )} \cos {\left (c + d x \right )}}{8} + \frac {3 x \sin {\left (a - d x \right )} \sin {\left (c + d x \right )} \cos ^{2}{\left (a - d x \right )}}{8} - \frac {3 x \cos ^{3}{\left (a - d x \right )} \cos {\left (c + d x \right )}}{8} + \frac {\sin ^{3}{\left (a - d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {3 \sin ^{2}{\left (a - d x \right )} \sin {\left (c + d x \right )} \cos {\left (a - d x \right )}}{4 d} + \frac {3 \sin {\left (c + d x \right )} \cos ^{3}{\left (a - d x \right )}}{8 d} & \text {for}\: b = - d \\\frac {x \sin ^{3}{\left (a - \frac {d x}{3} \right )} \sin {\left (c + d x \right )}}{8} - \frac {3 x \sin ^{2}{\left (a - \frac {d x}{3} \right )} \cos {\left (a - \frac {d x}{3} \right )} \cos {\left (c + d x \right )}}{8} - \frac {3 x \sin {\left (a - \frac {d x}{3} \right )} \sin {\left (c + d x \right )} \cos ^{2}{\left (a - \frac {d x}{3} \right )}}{8} + \frac {x \cos ^{3}{\left (a - \frac {d x}{3} \right )} \cos {\left (c + d x \right )}}{8} - \frac {7 \sin ^{3}{\left (a - \frac {d x}{3} \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {3 \sin {\left (a - \frac {d x}{3} \right )} \cos ^{2}{\left (a - \frac {d x}{3} \right )} \cos {\left (c + d x \right )}}{4 d} - \frac {3 \sin {\left (c + d x \right )} \cos ^{3}{\left (a - \frac {d x}{3} \right )}}{8 d} & \text {for}\: b = - \frac {d}{3} \\\frac {x \sin ^{3}{\left (a + \frac {d x}{3} \right )} \sin {\left (c + d x \right )}}{8} + \frac {3 x \sin ^{2}{\left (a + \frac {d x}{3} \right )} \cos {\left (a + \frac {d x}{3} \right )} \cos {\left (c + d x \right )}}{8} - \frac {3 x \sin {\left (a + \frac {d x}{3} \right )} \sin {\left (c + d x \right )} \cos ^{2}{\left (a + \frac {d x}{3} \right )}}{8} - \frac {x \cos ^{3}{\left (a + \frac {d x}{3} \right )} \cos {\left (c + d x \right )}}{8} - \frac {7 \sin ^{3}{\left (a + \frac {d x}{3} \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {3 \sin {\left (a + \frac {d x}{3} \right )} \cos ^{2}{\left (a + \frac {d x}{3} \right )} \cos {\left (c + d x \right )}}{4 d} + \frac {3 \sin {\left (c + d x \right )} \cos ^{3}{\left (a + \frac {d x}{3} \right )}}{8 d} & \text {for}\: b = \frac {d}{3} \\\frac {3 x \sin ^{3}{\left (a + d x \right )} \sin {\left (c + d x \right )}}{8} + \frac {3 x \sin ^{2}{\left (a + d x \right )} \cos {\left (a + d x \right )} \cos {\left (c + d x \right )}}{8} + \frac {3 x \sin {\left (a + d x \right )} \sin {\left (c + d x \right )} \cos ^{2}{\left (a + d x \right )}}{8} + \frac {3 x \cos ^{3}{\left (a + d x \right )} \cos {\left (c + d x \right )}}{8} - \frac {5 \sin ^{3}{\left (a + d x \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {3 \sin {\left (a + d x \right )} \cos ^{2}{\left (a + d x \right )} \cos {\left (c + d x \right )}}{4 d} + \frac {3 \sin {\left (c + d x \right )} \cos ^{3}{\left (a + d x \right )}}{8 d} & \text {for}\: b = d \\- \frac {9 b^{3} \sin ^{2}{\left (a + b x \right )} \sin {\left (c + d x \right )} \cos {\left (a + b x \right )}}{9 b^{4} - 10 b^{2} d^{2} + d^{4}} - \frac {6 b^{3} \sin {\left (c + d x \right )} \cos ^{3}{\left (a + b x \right )}}{9 b^{4} - 10 b^{2} d^{2} + d^{4}} + \frac {7 b^{2} d \sin ^{3}{\left (a + b x \right )} \cos {\left (c + d x \right )}}{9 b^{4} - 10 b^{2} d^{2} + d^{4}} + \frac {6 b^{2} d \sin {\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )} \cos {\left (c + d x \right )}}{9 b^{4} - 10 b^{2} d^{2} + d^{4}} + \frac {3 b d^{2} \sin ^{2}{\left (a + b x \right )} \sin {\left (c + d x \right )} \cos {\left (a + b x \right )}}{9 b^{4} - 10 b^{2} d^{2} + d^{4}} - \frac {d^{3} \sin ^{3}{\left (a + b x \right )} \cos {\left (c + d x \right )}}{9 b^{4} - 10 b^{2} d^{2} + d^{4}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 89, normalized size = 0.92 \begin {gather*} \frac {\sin \left (3 \, b x + d x + 3 \, a + c\right )}{8 \, {\left (3 \, b + d\right )}} - \frac {\sin \left (3 \, b x - d x + 3 \, a - c\right )}{8 \, {\left (3 \, b - d\right )}} - \frac {3 \, \sin \left (b x + d x + a + c\right )}{8 \, {\left (b + d\right )}} + \frac {3 \, \sin \left (b x - d x + a - c\right )}{8 \, {\left (b - d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.72, size = 494, normalized size = 5.09 \begin {gather*} {\mathrm {e}}^{a\,3{}\mathrm {i}-c\,1{}\mathrm {i}+b\,x\,3{}\mathrm {i}-d\,x\,1{}\mathrm {i}}\,\left (\frac {-3\,b^3-b^2\,d+3\,b\,d^2+d^3}{b^4\,144{}\mathrm {i}-b^2\,d^2\,160{}\mathrm {i}+d^4\,16{}\mathrm {i}}+\frac {{\mathrm {e}}^{-a\,6{}\mathrm {i}-b\,x\,6{}\mathrm {i}}\,\left (-3\,b^3+b^2\,d+3\,b\,d^2-d^3\right )}{b^4\,144{}\mathrm {i}-b^2\,d^2\,160{}\mathrm {i}+d^4\,16{}\mathrm {i}}-\frac {{\mathrm {e}}^{-a\,2{}\mathrm {i}-b\,x\,2{}\mathrm {i}}\,\left (-27\,b^3-27\,b^2\,d+3\,b\,d^2+3\,d^3\right )}{b^4\,144{}\mathrm {i}-b^2\,d^2\,160{}\mathrm {i}+d^4\,16{}\mathrm {i}}-\frac {{\mathrm {e}}^{-a\,4{}\mathrm {i}-b\,x\,4{}\mathrm {i}}\,\left (-27\,b^3+27\,b^2\,d+3\,b\,d^2-3\,d^3\right )}{b^4\,144{}\mathrm {i}-b^2\,d^2\,160{}\mathrm {i}+d^4\,16{}\mathrm {i}}\right )-{\mathrm {e}}^{a\,3{}\mathrm {i}+c\,1{}\mathrm {i}+b\,x\,3{}\mathrm {i}+d\,x\,1{}\mathrm {i}}\,\left (\frac {-3\,b^3+b^2\,d+3\,b\,d^2-d^3}{b^4\,144{}\mathrm {i}-b^2\,d^2\,160{}\mathrm {i}+d^4\,16{}\mathrm {i}}+\frac {{\mathrm {e}}^{-a\,6{}\mathrm {i}-b\,x\,6{}\mathrm {i}}\,\left (-3\,b^3-b^2\,d+3\,b\,d^2+d^3\right )}{b^4\,144{}\mathrm {i}-b^2\,d^2\,160{}\mathrm {i}+d^4\,16{}\mathrm {i}}-\frac {{\mathrm {e}}^{-a\,2{}\mathrm {i}-b\,x\,2{}\mathrm {i}}\,\left (-27\,b^3+27\,b^2\,d+3\,b\,d^2-3\,d^3\right )}{b^4\,144{}\mathrm {i}-b^2\,d^2\,160{}\mathrm {i}+d^4\,16{}\mathrm {i}}-\frac {{\mathrm {e}}^{-a\,4{}\mathrm {i}-b\,x\,4{}\mathrm {i}}\,\left (-27\,b^3-27\,b^2\,d+3\,b\,d^2+3\,d^3\right )}{b^4\,144{}\mathrm {i}-b^2\,d^2\,160{}\mathrm {i}+d^4\,16{}\mathrm {i}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________